<?php   
	 if (!function_exists('DoiTien')) { 
		 function DoiTien($NgonNgu1,$Tien)
		 { 
			$str ="";
			if ($Tien=='') {
				if($NgonNgu1=="vi")
					 $str= '00 VNĐ'; 
				else
					$str= '$ 00';
			} 
			$t = trim(preg_replace('/([^0-9\.])/i', '', $Tien)); 
			if($NgonNgu1=="vi") 
				$str= number_format($t,0,'.',',')." VNĐ";
			else
				$str= '$ '. number_format(round($t/20000,2),2,'.',',') ;
			return $str;
		 }
	  }
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="<?php echo base_url()?>images/icon.ico" type="image/x-icon" rel="shortcut icon" />
<title><?php echo $title ?></title>   
 
<link rel="stylesheet" type="text/css" href="<?php echo base_url() ?>stylesheet/TrangChu.css"/>
<link rel="stylesheet" type="text/css" href="<?php echo base_url() ?>stylesheet/tabcontent.css"/>
<script type="text/javascript" src="<?php echo base_url() ?>scripts/jquery-1.9.0.js"></script>
<script type="text/javascript" src="<?php echo base_url() ?>scripts/trangchu/tabcontent.js" ></script> 
<script type="text/javascript" src="<?php echo base_url() ?>scripts/jquery.validate.js"></script>
<script type="text/javascript" src="<?php echo base_url() ?>scripts/localization/messages_vi.js"></script>
<script type="text/javascript" src="<?php echo base_url() ?>scripts/trangchu/form_validate_dathang.js"></script>
<script type="text/javascript" >
 $(document).ready(function(){ 
        $(".ChiTietGio").hide();
        $(".GioHang").show(); 
    $('.GioHang').click(function(){
    $(".ChiTietGio").slideToggle();
    }); 
}); 
</script>

<script>
        (function(d, s, id) {
            var js, fjs = d.getElementsByTagName(s)[0];
            if (d.getElementById(id)) return;
            js = d.createElement(s); js.id = id;
            js.src = "//connect.facebook.net/vi_VN/all.js#xfbml=1&appId=241051805987762";
            fjs.parentNode.insertBefore(js, fjs);
        }(document, 'script', 'facebook-jssdk'));
    </script>
</head> 
<body> 
<div class="body"><!-- body-->

<div class="Trai"><!-- body,Trai (ria ben trai)-->
    <img src="<?php echo base_url() ?>Hinh/az_header_border_left.png" width="42" height="318" />
    <img src="<?php echo base_url() ?>Hinh/az_body_left.jpg" width="42" height="732" /> 
</div>
<div class="Giua"> <!-- body,Giua  (Phần thân gồm Header Content Footer)--> 
	<div class="header"> <!-- body-Giua-header  (Phần Header) -->           
      <div class="header_Phai" ><!-- body,Giua,header,header_Phai --> 
            <div class="header_Tren"><!-- body,Giua,header,header_Phai,header_Tren --> 
               <div class="GioHang" ><!-- body,Giua,header,header_Phai,header_Tren,GioHang --> 
                   
                    <a href="<?php echo base_url() ?>index.php/<?php echo $language ?>/Giohang/GioHang"> 
                    	<img src="<?php echo base_url() ?>Hinh/az_cart.jpg" width="64" height="63" />
                    </a><!--YES-->
                    <a href="<?php echo base_url() ?>index.php/<?php echo $language; ?>/Giohang/GioHang" class="TD_giohang">
                    	 <?php echo $this->lang->line('giohang') ; ?> 
                    </a><!--YES--> 
                    <p><?php echo $this->lang->line('giohangbanco') ; echo "  (".$this->cart->total_items().") ";?>  </p>
                    <p><?php echo $this->lang->line('tongtien') ;?> - <?php echo DoiTien($language,$this->cart->total()); ?> </p><!--NO-->
                </div>  
                <div class="ChiTietGio">
                     <table> 
                      <tbody>   
							<?php $i = 1; ?> 
							<?php foreach ($this->cart->contents() as $items): ?> 
                                <tr>
                                      <td><img src="<?php echo base_url().$items['Hinh']; ?>" alt="<?php echo $items['Hinh']; ?>"  /></td>
                                      <td> <?php echo $items['name']; ?>  </td> 
                                      <td><?php echo  $items['qty'];?>  </td>
                                      <td style="text-align:right"><?php echo DoiTien($language,$items['price']); ?></td>
                                      <td style="text-align:right"><?php echo DoiTien($language,$items['subtotal']);  ?> </td>
                                </tr> 
                            	<?php $i++; ?> 
                            <?php endforeach; ?>
                      </tbody>
                    </table>
                </div>
                <div class="NguonNgu" > 
                    <p class="TieuDe_hd"><?php echo $this->lang->line('ngonngu') ; ?></p>
                    <a  href="<?php echo base_url() ?>index.php/<?php echo $language ?>/Ngonngu/en"> 
                    <img src="<?php echo base_url() ?>Hinh/NN_A.gif" width="26" height="17" /></a>
                    <a href="<?php echo base_url() ?>index.php/<?php echo $language ?>/Ngonngu/vi"> 
                    <img src="<?php echo base_url() ?>Hinh/NN_NV.jpg" width="26" height="17" /></a>	
                </div>  
            </div>
            <div class="header_Duoi">
            </div>
        </div>
        <div class="header_Trai" ><!-- body,Giua,header,header_Trai --> 
             <img src="<?php echo base_url() ?>Hinh/az_header.jpg" width="290" height="318" />
             <img src="<?php echo base_url() ?>Hinh/az_searchbox_bg.jpg" width="290" height="131" />
        </div>
	</div><!-- body,Giua,header  (Phần Header) -->   